<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	
	<p:fieldset>
		<h:panelGrid id="aparelho_form" columns="1" cellpadding="0" width="100%">
			
			<h:outputText value="#{appLabels.aparelho_att_tipoAparelho}" />
			<p:selectOneMenu value="#{aparelhoMB.modeloEdicao.tipoAparelho}" label="#{appLabels.aparelho_att_tipoAparelho}" converter="TipoAparelho_Converter" style="width:350px;" >
				<f:selectItem itemLabel="Selecione ..." />
				<f:selectItems var="tipo" itemLabel="#{tipo.descricao}" value="#{aparelhoMB.listaTipoAparelho}"/>
			</p:selectOneMenu>

			<h:outputText value="#{appLabels.aparelho_att_marcaAparelho}" />
			<p:selectOneMenu value="#{aparelhoMB.modeloEdicao.marcaAparelho}" label="#{appLabels.aparelho_att_marcaAparelho}" converter="MarcaAparelho_Converter" style="width:350px;" >
				<f:selectItem itemLabel="Selecione ..." />
				<f:selectItems var="marca" itemLabel="#{marca.descricao}" value="#{aparelhoMB.listaMarcaAparelho}"/>
			</p:selectOneMenu>

			<h:outputText value="#{appLabels.aparelho_att_modelo}" />
			<p:inputText label="#{appLabels.aparelho_att_modelo}" value="#{aparelhoMB.modeloEdicao.modelo}" required="true" style="width:350px" />
			
			<h:outputText value="#{appLabels.entidade_auditavel_att_ativo}" />
			<p:selectBooleanCheckbox label="#{appLabels.entidade_auditavel_att_ativo }" value="#{aparelhoMB.modeloEdicao.ativo}" /> 				

			<h:panelGrid id="tabs_form" columns="1" cellpadding="0" width="100%">
				<p:tabView>
					<p:tab title="#{appLabels.aparelho_att_descricao}">
						<p:editor value="#{aparelhoMB.modeloEdicao.descricao}" width="600" />
					</p:tab>
					<p:tab title="#{appLabels.aparelho_att_foto1}">
						<h:panelGrid id="fotos_form" columns="2" cellpadding="10" width="100%">
							<h:outputText value="#{appLabels.aparelho_att_foto1}" />
							<p:fileUpload mode="simple" value="aparelhoMB.modeloEdicao.foto1" />
				
							<h:outputText value="#{appLabels.aparelho_att_foto2}" />
							<p:fileUpload mode="simple" value="aparelhoMB.modeloEdicao.foto2" />
				
							<h:outputText value="#{appLabels.aparelho_att_foto3}" />
							<p:fileUpload mode="simple" value="aparelhoMB.modeloEdicao.foto3" />
						</h:panelGrid>
					</p:tab>
				</p:tabView>
			</h:panelGrid>

			<f:facet name="footer">
				<p:commandButton value="#{appLabels.botao_crud_save}" action="#{aparelhoMB.salvarAction}" icon="saveIcon" update="form"/>
				<p:commandButton value="#{appLabels.botao_crud_cancelar}" action="#{aparelhoMB.irParaPesquisa}" icon="cancelIcon" immediate="true" update="form" />
			</f:facet>
		</h:panelGrid>
	</p:fieldset>
</html>